<?php
namespace app\admin\controller;
use think\Controller;
// use think\Request;
use think\facade\Request;
use think\facade\Db;

class Index extends Controller
{
    public function index()
    {
        // return '<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} a{color:#2E5CD5;cursor: pointer;text-decoration: none} a:hover{text-decoration:underline; } body{ background: #fff; font-family: "Century Gothic","Microsoft yahei"; color: #333;font-size:18px;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.6em; font-size: 42px }</style><div style="padding: 24px 48px;"> <h1>:) </h1><p> ThinkPHP V5.1<br/><span style="font-size:30px">12载初心不改（2006-2018） - 你值得信赖的PHP框架</span></p></div><script type="text/javascript" src="https://tajs.qq.com/stats?sId=64890268" charset="UTF-8"></script><script type="text/javascript" src="https://e.topthink.com/Public/static/client.js"></script><think id="eab4b9f840753f8e7"></think>';
        // return "测试测试，阿巴阿巴";
        // return $this->fetch();
        // return view ('index',['name'=>'zhansan','age'=>18]);

        // 渲染模板输出 view('[模板文件]',['模板变量(数组)']);
        // $data=['name'=>'zhansan','age'=>18];
        // return $this->fetch('index',['name'=>'zhansan','age'=>18]);//fetch使用方法
        // return view ('index',['data'=>$data]);

        //全局变量赋值
        // $this->assign('name','lisi');
        // return view();

        //请求
        //请求对象调用 1、构造方法注入
        // $data= $this->request->param();
        // dump($data);
    //    2、静态调用请求对象
        // return Request::param('name');

        // Db::table('user')->select();
        return $this->fetch();
    }
    //  配合请求使用
    // public function __construct(Request $request)
    // {
    //     $this->request = $request;
    // }
}
